package com.wzh.frame.views;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.wzh.frame.R;

/**
 * Created by Hu on 2016/11/30.
 */

public class CustomDialog extends AlertDialog {
    public static final int NORMAL_TYPE = 0;
    public static final int ERROR_TYPE = 1;
    public static final int SUCCESS_TYPE = 2;
    public static final int WARNING_TYPE = 3;
    public static final int CUSTOM_IMAGE_TYPE = 4;
    public static final int PROGRESS_TYPE = 5;
    public static final int HWZ_EDIT = 6;
    public static final int HWZ_ListView = 7;
    public static final int CHECKUP_TYPE = 8;
    public static final int UPDATE_TYPE = 9;
    public static final int HTML_TYPE = 10;
    private int mAlertType;

    private TextView mTitleTextView, mContentTextView;
    private Button mConfirmButton, mCancelButton;


    public CustomDialog(Context context, int alertType) {
        super(context, R.style.alert_dialog);
        mAlertType = alertType;
    }

    protected CustomDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fiexo_dialog);
        initView();
    }

    private void initView() {
        //标题头
        mTitleTextView = (TextView) findViewById(R.id.title_text);
        //主内容
        mContentTextView = (TextView) findViewById(R.id.content_text);
        //确认按钮
        mConfirmButton = (Button) findViewById(R.id.confirm_button);
        //取消按钮
        mCancelButton = (Button) findViewById(R.id.cancel_button);


        changeAlertType(mAlertType, true);
    }

    private void changeAlertType(int alertType, boolean fromCreate) {
        mAlertType = alertType;
        switch (mAlertType) {
            case ERROR_TYPE:

                break;
            case SUCCESS_TYPE:

                break;
            case WARNING_TYPE:

                break;
            case CUSTOM_IMAGE_TYPE:

                break;
            case PROGRESS_TYPE:
                break;
            case HWZ_EDIT:

            break;
            case HWZ_ListView:

                break;
            case CHECKUP_TYPE:

                break;
            case UPDATE_TYPE:

                break;
            case HTML_TYPE:

                break;

        }

    }
}
